app.controller('OpsController', function ($scope) {

	$scope.reload = $scope.page.loader('log/ops/{pageIndex}/{pageSize}/page');
	$scope.$on('pageIndex', function (event, p) { $scope.reload(p, $scope.queryMap); });
	$scope.reload(1);

	$scope.queryMap = {};
	$scope.timeRange = {};
	$scope.query = function () {
		if ($scope.timeRange.startTime && $scope.timeRange.endTime) {
			var starTime = $scope.timeRange.startTime.pattern("yyyy-MM-dd");
			var endTime = $scope.timeRange.endTime.pattern("yyyy-MM-dd");
			$scope.queryMap.opsTime = starTime + "#@" + endTime;
		} else if ($scope.timeRange.startTime == null || $scope.timeRange.endTime == null) {
			delete $scope.queryMap.opsTime;
		}
		$scope.reload(1, $scope.queryMap);
	};
});
